DEFINITION MODULE BitStuff;

(* Bitwise logical operators for integers - 12/29/87 - Michael A. Long *)

PROCEDURE BitAnd(a,b : INTEGER) : INTEGER;

   (* Performs a bitwise AND of integers a and b *)

PROCEDURE BitOr(a,b : INTEGER) : INTEGER;

   (* Performs a bitwise OR of integers a and b *)

PROCEDURE BitXor(a,b : INTEGER) : INTEGER;

   (* Performs a bitwise XOR of integers a and b *)

PROCEDURE SetBit(bit       : INTEGER;
                 VAR field : INTEGER);

   (* Sets bit in field *)

PROCEDURE ClearBit(bit       : INTEGER;
                   VAR field : INTEGER);

   (* Clears bit in field *)

PROCEDURE TestBit(bit,field : INTEGER) : BOOLEAN;

   (* Tests bit in field. Returns TRUE if set. *)

END BitStuff.
